#include <iostream>
using namespace std;

typedef long long LL;
const int N = 55, M = 15;
const LL INF = 0x3f3f3f3f3f3f3f3f;

int n, k, d;
LL arr[N];
LL f[N][M], g[N][M];
int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> arr[i];

    cin >> k >> d;
    for (int i = 1; i <= n; i++)
    {
        g[i][1] = f[i][1] = arr[i];
        for (int j = 2; j <= min(i, k); j++)
        {
            f[i][j] = -INF;
            g[i][j] = INF;
            for (int prev = max(i - d, j - 1); prev <= i - 1; prev++)
            {
                f[i][j] = max(max(f[prev][j - 1] * arr[i], g[prev][j - 1] * arr[i]), f[i][j]);
                g[i][j] = min(min(f[prev][j - 1] * arr[i], g[prev][j - 1] * arr[i]), g[i][j]);
            }
        }
    }
    LL ret = -INF;
    for (int i = k; i <= n; i++) ret = max(ret, f[i][k]);

    cout << ret << endl;
    return 0;
}